<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.ys.malini.util.PagerContext"%>
<%@ include file="/pages/include/taglibs.jsp" %>
<%
	session.setAttribute("ctx",request.getContextPath());
%>
<html:html lang="true">
	<head>
	

		<TITLE>展厅信息查询</TITLE>
		
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">    
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" >
<link href="<%=request.getContextPath()%>/css/button.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
var path ='${basePath}';


function deleteme(roomId){	
	
	if(confirm('删除该记录：'+roomId+'？')){
		document.forms[0].action='<%=session.getAttribute("ctx")%>/roomAction.do?op=delete&roomId='+roomId;			
		document.forms[0].submit();  
	}				  
}

function addRoom(){	
	document.forms[0].action='<%=session.getAttribute("ctx")%>/roomAction.do?op=toAdd';			
	document.forms[0].submit();  
			  
}
		</script>
</head>
<body bgcolor="#F0F0F0">
 <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr><td>
<html:form action="/roomAction.do?op=query" method="post">
	
			<logic:present name="message" scope="request">
			<table>
				<tr>
					<td width="150" align="right"></td>
					<td>
						<font color="red">${message}</font>
					</td>
				</tr>
			</table>
		</logic:present>
</td></tr>
<tr><td>
	<table width="99%" border="1" align="center" cellpadding="2" cellspacing="2">
    	<tr class="list_hd">
    		<td with="20%" nowrap>展厅名称</td>			
			<td with="30%" nowrap>展厅地址</td>	
			<td with="20%" nowrap>展厅图片</td>					
			<td with="30%" nowrap>操作</td>
		</tr>
	
		<logic:present name="roomlist" scope="request">			
			<logic:iterate id="data" name="roomlist" scope="request"
				type="com.ys.malini.model.TShowroominfo">				
				<tr>
					<td nowrap>${data.ztname}&nbsp;</td>
					<td nowrap>${data.adress}&nbsp;</td>	
					<td nowrap>
						<img src="<%=session.getAttribute("ctx")%>/${data.smimages}" />
					</td> 										
					<td nowrap>
						<html:link page="/roomAction.do?op=toUpdate&roomId=${data.roomId}">
							<font color="blue">修改</font>							
						</html:link>					
						|					
				      <a href="javascript:void(0)" onclick="javascript:deleteme('${data.roomId}')" styleId="deleteLink"><font color="blue">删除</font></a>
				      	
                    </td>	
				</tr>
		</logic:iterate>
			<div class="page">
				<TABLE width="70%">
						<TBODY>
							<TR class="list_hd">
								<TD height=28 align=right vAlign="middle" noWrap >
								总页数:<%=com.ys.malini.util.PagerContext.getTotal()/com.ys.malini.util.PagerContext.getPagesize()+1%>
									&nbsp;&nbsp;					
									<pg:pager url="./roomAction.do"							
										items="<%=PagerContext.getTotal()%>"							
										maxPageItems="<%=PagerContext.MAX_PAGE_SIZE%>"
										export="currentPageNumber=pageNumber" scope="request">
										<pg:param name="op" value="query"/>
										<%@include file="/pages/include/pager.jsp"%>
									</pg:pager>						
										
									
									</TD>
							</TR>
						</TBODY>
					</TABLE>
			
			</div>
		</logic:present>
		
		<tr>
			<td colspan="4"><html:button property="add" value="新增" onclick="addRoom()"></html:button></td>
		</tr>
	  </table>
	  </html:form>
</td></tr></table>
 </body>
</html:html>
